package com.thread.exe;

public class BoundedBuffer<V> extends BaseBoundedBuffer<V>{

	protected BoundedBuffer(int capacity) {
		super(capacity);
	}
	
	public synchronized void put(V v) throws InterruptedException {
		if(isFull())
			doPut(v);
		notifyAll();
	}
	
	public synchronized V take() throws InterruptedException {
		if(isEmpty())
			wait();
		V v = doTake();
		notifyAll();
		return v;
	}
}
